import 'package:url_launcher/url_launcher.dart';

///基于scheme的应用间跳转，qq为 qq号
jump(String qq) async {
  Uri quickChat = Uri.parse(
      //打开qq临时聊天界面
      "mqqapi://im/chat?chat_type=wpa&version=1&src_type=external&uin=$qq");
  Uri infoCard = Uri.parse(
      //打开资料卡
      "mqqapi://card/show_pslcard?src_type=external&version=1&uin=$qq");

  bool res = false;
  if (await canLaunchUrl(quickChat)) {
    res = await launchUrl(
      quickChat,
      mode: LaunchMode.externalApplication,
      //可以添加 header作为参数，待研究
      //webViewConfiguration: const WebViewConfiguration(headers: {})
    );
  } else if (await canLaunchUrl(infoCard)) {
    res = await launchUrl(infoCard, mode: LaunchMode.externalApplication);
  }
  return res;
}
